package com.sfang.common.util.json;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

import java.lang.reflect.Type;

public class GsonUtil {
    private static Gson GSON = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").create();

    public static String toJsonString(Object src) {
        return GSON.toJson(src);
    }

    public static <T> T parseObject(String src, Type type) {
        return GSON.fromJson(src,type);
    }
}
